﻿using System.Collections.Generic;
using System.Data;
using PPI.Entities.Lookup;
using VMind.Global;

namespace PPI.Client.Logic.Distribution
{
    public class LClass
    {
        public static List<EXMissionStructures_PoleClass> SelectAllIdName()
        {
            DataTable dt = WebConsumer.Distribution.WDistributionClass.SelectAllIdName().Tables[0];
            List<EXMissionStructures_PoleClass> lstClasses = new List<EXMissionStructures_PoleClass>();

            foreach (DataRow drClass in dt.Rows)
            {
                EXMissionStructures_PoleClass classEntity = new EXMissionStructures_PoleClass();

                classEntity.Id = ConvertHelper.ToInt32(drClass["ClassId"]);
                classEntity.Name = drClass["Name"].ToString();

                lstClasses.Add(classEntity);
            }

            return lstClasses;
        }
    }
}
